﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace PersonalDiary
{
    /// <summary>
    /// MainWindow.xaml에 대한 상호 작용 논리
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();

            this.MouseDown += MainWindow_MouseDown;
            this.ui_CloseButton.Click += ui_CloseButton_Click;
            this.ui_MaxButton.Click += ui_MaxButton_Click;
            this.ui_MinButton.Click += ui_MinButton_Click;
            this.ui_RestoreButton.Click += ui_RestoreButton_Click;
        }

        void ui_RestoreButton_Click(object sender, RoutedEventArgs e)
        {
            this.WindowState = WindowState.Normal;
            this.ui_RestoreButton.Visibility = Visibility.Collapsed;
            this.ui_MaxButton.Visibility = Visibility.Visible;
        }

        void ui_MinButton_Click(object sender, RoutedEventArgs e)
        {
            this.WindowState = WindowState.Minimized;
        }

        void ui_MaxButton_Click(object sender, RoutedEventArgs e)
        {
            this.WindowState = WindowState.Maximized;
            this.ui_RestoreButton.Visibility = Visibility.Visible;
            this.ui_MaxButton.Visibility = Visibility.Collapsed;
        }

        void ui_CloseButton_Click(object sender, RoutedEventArgs e)
        {
            this.Close();
        }

        void MainWindow_MouseDown(object sender, MouseButtonEventArgs e)
        {
            this.DragMove();
        }
    }
}
